/*
 * Rhy Configuration Core Lib
 * 
 * @author Tristan Maindron
 * 
 */

Rhy.config = {};

Rhy.config.manager = {
    merge: function(base, o){
        var r = {};

        for(var i in base)
            r[i] = base[i];

        for(var j in o)
            r[j] = o[j];

        return r;
    },

    encode: function(o){
        var param = new Array();
        for(var i in o)
            param.push(i + '=' + encodeURIComponent(o[i]));
        return param.join('&');
    },
    
    decode: function(o){
        var tks = o.split('&');
        var r = {};
        for(var i in tks){
            var stks = tks[i].split('=');
            r[stks[0]] = stks[1];
        }
        return r;
    }
};

Rhy.config.mgr = Rhy.config.manager;
